
const index = resolve => require.ensure([], () => {
  resolve(require('@/components/index.vue'))
})
const roles = resolve => require.ensure([], () => {
  resolve(require('@/components/roles.vue'))
})

const accounts = resolve => require.ensure([], () => {
  resolve(require('@/components/accounts.vue'))
})

const goods = resolve => require.ensure([], () => {
  resolve(require('@/components/goods.vue'))
})

const list = resolve => require.ensure([], () => {
  resolve(require('@/components/list.vue'))
})

export default [
  {
    path: '/',
    name: '首页',
    component: index,
    meta: {
      icon: 'home'
    },
    children: [
      {
        path: '/roles',
        name: '平台-角色管理',
        meta: {
          name: '角色管理',
          icon: 'man'
        },
        component: roles
      },
      {
        path: '/accounts',
        name: '平台-账号管理',
        meta: {
          name: '账号管理',
          icon: 'leaf'
        },
        component: accounts
      },
      {
        path: '/goods',
        name: '商品管理',
        meta: {
          icon: 'ios-cog'
        },
        component: goods,
        children: [
          {
            path: 'list',
            name: '商品信息',
            meta: {
              icon: 'cube'
            },
            component: list
          }
        ]
      }
    ]
  }
]
